<?php

namespace app\admin\validate;

use think\Validate;

class AdjustConfig extends Validate
{
    //字段规则
    protected $rule = [
        'name' => 'require',
        'identify' => 'require|unique:adjust_config',
    ];

    //验证器提示信息
    protected $message = [
        'name.require' => '请输入标识名字',
        'identify.unique' => '唯一标识不可重复',
        'identify.require' => '请输入唯一标识',
    ];

    //使用场景
    protected $scene = [
        'add'  =>  ['name','identify'],
        'edit'   => ['name' => 'require']
    ];
}